﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameRobot;

namespace GameRobotControl
{
    class SampleManualRobotAction : ManualRobotAction
    {
        public SampleManualRobotAction(RobotBridge robotbride)
            : base(robotbride)
        {
            _robot = new SampleManualRobotActionImpl(robotbride);
        }

        public override void Action(GameInput gameinput)
        {
            GameMessage action = new GameMessage();
            switch (gameinput.game_message.message)
            {
                case messagedef.MoveAhead:
                    action.message = messagedef.MoveAhead;
                    break;
                case messagedef.StopAllAction:
                    action.message = messagedef.StopAllAction;
                    break;
                case messagedef.TurnLeft:
                    action.message = messagedef.TurnLeft;
                    break;
                case messagedef.TurnRight:
                    action.message = messagedef.TurnRight;
                    break;
            }
            SampleManualRobotActionImpl robot = (SampleManualRobotActionImpl)(_robot);
            robot.ManualAction(action);
        }
    }
}
